//
// Created by liushuai on 12/22/19.
//
#include "reverseLinklist.h"
ListNode *reverseLinklist(ListNode *head) {
    ListNode *currentNode = head;
    ListNode *preNode = nullptr;
    ListNode *tailNode = nullptr;
    while (currentNode) {
        ListNode *nextNode = currentNode->next;
        currentNode->next = preNode;
        preNode = currentNode;
        currentNode = nextNode;
    }
    return preNode;
};
